<include file="Public/header" />
<title>我的桌面</title>
</head>
<body>
<div class="pd-20">

		<table class="table table-border table-bordered table-hover table-bg" style="margin-top:20px;">
		<thead>
			<tr>
				<th scope="col" colspan="16">产品列表</th>
			</tr>
			<tr class="text-c">
				<th width="40">ID</th>
				<th width="40">单号</th>
				<th width="40">申请部门</th>
				<th width="100">批次</th>
				<th width="40">申请人</th>
				<th width="40">制单人</th>
				<th width="40">入库仓库</th>
				<th width="40">产品名称</th>
				<th width="40">产品规格</th>
				<th width="40">料号</th>
				<th width="40">产品编码</th>
				<th width="40">计划数量</th>
				<th width="40">主单位</th>
				<th width="40">生产周期要求</th>
				<th width="40">申请摘要</th>

				<th width="40">备注</th>
			</tr>
		</thead>
		<tbody>
			<tr class="text-c">

				<td><{$detail.id}></td>
				<td><{$detail.purchasing_no}></td>
				<td>
					<volist name="section_list" id="vo">
							<if condition="$vo['no'] eq $detail['section_no']"><{$vo.name}></if>
						</volist>
				</td>
				<td><{$detail.batch_no}></td>
				<td>
					<volist name="personnel_list" id="vo">
							<if condition="$vo['no'] eq $detail['people_purchasing_no']"><{$vo.name}></if>
						</volist>
				</td>
				<td>
					<volist name="personnel_list" id="vo">
								<if condition="$vo['no'] eq $detail['people_make_no']"><{$vo.name}></if>
							</volist>
				</td>
				<td>
					<volist name="warehouse_list" id="vo">
								<if condition="$vo['warehouse_code'] eq $detail['inbound_warehouse_code']"><{$vo.name}></if>
							</volist>
				</td>
				<td><{$detail.pro_name}></td>
				<td><{$detail.pro_spec}></td>
				<td><{$detail.source_no}></td>
				<td><{$detail.pro_no}></td>
				<td><{$detail.pro_num_plan}></td>
				<td>
				<volist name="unit_list" id="vo">
									<if condition="$vo['unit_no'] eq $detail['unit1']"><{$vo.unit_name}></if>
								</volist>
				</td>
				<td><{$detail.product_weeks}></td>
				<td><{$detail.product_marks}></td>
				<td>
					<{$detail.mark}>
				</td>
			</tr>
			<volist name="byproduct_list" id="vs">
				<tr class="text-c">
				<td><{$vs.id}>副<input type="hidden"   name="list_id" value="<{$vs.id}>" ></td>
				<td><{$detail.purchasing_no}></td>
				<td>

						<volist name="section_list" id="vo">
							<if condition="$vo['no'] eq $detail['section_no']"><{$vo.name}></if>
						</volist>
					</select>
				</td>
				<td><{$detail.batch_no}></td>
				<td>
						<volist name="personnel_list" id="vo">
							<if condition="$vo['no'] eq $detail['people_purchasing_no']"><{$vo.name}></if>
						</volist>
				</td>
				<td>
							<volist name="personnel_list" id="vo">
								<if condition="$vo['no'] eq $detail['people_make_no']"><{$vo.name}></if>
							</volist>
				</td>
				<td>
							<volist name="warehouse_list" id="vo">
								<if condition="$vo['warehouse_code'] eq $detail['inbound_warehouse_code']"><{$vo.name}></if>
							</volist>
				</td>
				<td><{$vs.pro_name}></td>
				<td><{$vs.pro_spec}></td>
				<td><{$vs.source_no}></td>
				<td><{$vs.pro_no}></td>
				<td><{$vs.pro_num_plan}></td>
				<td>
				<volist name="unit_list" id="vo">
									<if condition="$vo['unit_no'] eq $vs['unit1']"><{$vo.unit_name}></if>
								</volist>
				</td>
				<td><{$vs.product_weeks}></td>
				<td><{$vs.product_marks}></td>
				<td>
					<{$vs.mark}>
				</td>
			</tr>
			</volist>
		</tbody>
	</table>
	
<table class="table table-border table-bordered table-hover table-bg" style="margin-top:20px;">
		<thead>
			<tr>
				<th scope="col" colspan="13">原料列表</th>
			</tr>
			<tr class="text-c">
				<th width="40">ID</th>
				<th width="40">原料编码</th>
				<th width="40">原料名称</th>
				<th width="100">账册编码</th>
				<th width="40">料号</th>
				<th width="40">规格</th>
				<th width="40">币制</th>
				<th width="40">单价</th>
				<th width="40">主单位</th>
				<th width="40">主单位数量</th>
				<th width="40">备注</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
			 <input  name='gid' type="hidden" style="width:80px;" value="<{$vo['id']}>"/>
				<td><{$vo.id}></td>
				<td>
					<input  name='goods_no' type="hidden" style="width:80px;" value="<{$vo['goods_no']}>"/>
				<{$vo.goods_no}>
				</td>
				<td><{$vo.goods_name}></td>
				<td><{$vo.manua_id}></td>
				<td><{$vo.source_no}></td>
				<td>
					 <{$vo['goods_spec']}>
				</td>
				<td><{$vo.currency_name}></td>
				<td>
					 <{:round($vo['price'],2)}>
				</td>
				<td>
					 <{$vo.unit1_name}>
				</td>
				<td>
					<input  name='weight' type="text" style="width:80px;" value="<{$vo['weight']}>"/>
				</td>
				<td>
					<input  name='mark' type="text" style="width:80px;" value="<{$vo['mark']}>"/>
				</td>
			</tr>
			</volist>
		</tbody>
	</table>
	<table class="table table-border table-bordered table-hover table-bg" style="margin-top:20px;">
		<thead>
			<tr>
				<th scope="col" colspan="13">辅料列表</th>
			</tr>
			<tr class="text-c">
				<th width="40">ID</th>
				<th width="40">辅料编码</th>
				<th width="40">辅料名称</th>
				<th width="100">账册编码</th>
				<th width="40">料号</th>
				<th width="40">规格</th>
				<th width="40">币制</th>
				<th width="40">单价</th>
				<th width="40">主单位</th>
				<th width="40">主单位数量</th>
				<th width="40">总金额</th>
				<th width="40">备注</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list_f" id="vo">
			<tr class="text-c">
			 <input  name='gid' type="hidden" style="width:80px;" value="<{$vo['id']}>"/>
				<td><{$vo.id}></td>
				<td>
					<input  name='goods_no' type="hidden" style="width:80px;" value="<{$vo['goods_no']}>"/>
				<{$vo.goods_no}>
				</td>
				<td><{$vo.goods_name}></td>
				<td><{$vo.manua_id}></td>
				<td><{$vo.source_no}></td>
				<td>
					 <input  name='goods_spec' type="hidden" style="width:80px;" value="<{$vo['goods_spec']}>"/><{$vo['goods_spec']}>
				</td>
				<td><{$vo.currency_name}></td>
				<td>
					 <input  name='price' type="hidden" style="width:80px;" value="<{$vo['price']}>"/><{:round($vo['price'],2)}>
				</td>
				<td>
					 <{$vo.unit1_name}>
				</td>
				<td>
					<input  name='weight' type="text" style="width:80px;" value="<{$vo['weight']}>"/>
				</td>
				<td>
					 <{$vo.total_price}>
				</td>
				<td>
					<input  name='mark' type="text" style="width:80px;" value="<{$vo['mark']}>"/>
				</td>
			</tr>
			</volist>
		</tbody>
	</table>
	<input type="button" class="btn btn-primary radius mt" id="bedit" value="保存">
<div class="pages">
<{$page}>
</div>
</div>
<include file="Public/footer" />
<include file="Public/footer_js" />
<script type="text/javascript">
    $(function(){
		$(".del").click(function(){
			$(this).parent().remove();
		 })
		/*保存计划入库单数据*/
        $("#bedit").click(function(){
			var count=$('input[name=weight]').length;
			var gid=$('input[name=gid]');
			var weight=$('input[name=weight]');
			var mark=$('input[name=mark]');
			<!-- console.log(mark); -->
			if(count<1){
				layer.msg('没有添加原料');
				return false;
			}
			var str='';
			for(var i=0;i<count;i++){
				if(i==0){
					str=str+gid.eq(i).val()+":"+weight.eq(i).val()+":"+mark.eq(i).val();
				}else{
					str=str+","+gid.eq(i).val()+":"+weight.eq(i).val()+":"+mark.eq(i).val();
				}
			}
			<!-- console.log(mark.eq(0).val()); -->
			$.ajax({
                type: 'POST',
                data: {
						id:<{:I('id')}>,
						str:str
					  },
                url: "<{:U('edt')}>",
                success:function(data){
                    layer.msg(data.info,function(){
						if(data.status==0){
							return false;
						}else{
							self.window.location.href =self.window.location.href;
						}
					});
                }
            })
        });
    })

</script>
</body>
</html>
</html>